#Requires AutoHotkey v2.0
#SingleInstance Force

global MouseMoveSpeedVar := 120

mouseMoveSpeed(num) {
  global MouseMoveSpeedVar *= num
  KeyWait(A_ThisHotkey)
  MouseMoveSpeedVar /= num
}

;光标管理
`;:: {
  coordmode 'mouse', 'screen'
  static xpos := A_ScreenWidth/2
  static ypos := A_ScreenHeight/2
  KeyWaitTime := 300
  fixed() {
    ToolTip("KeyWaitTime is over!" . KeyWaitTime)
  }
  SetTimer(fixed, "-" . KeyWaitTime)
  KeyWait ";"
  if (KeyWaitTime < A_TimeSinceThisHotkey) {
    MouseGetPos &xpos, &ypos
    ToolTip()
  } else {
    SetTimer(fixed, 0)
    MouseMove(xpos, ypos)
  }
}

h:: MouseMove(-MouseMoveSpeedVar, 0, , "R")
j:: MouseMove(0, MouseMoveSpeedVar, , "R")
k:: MouseMove(0, -MouseMoveSpeedVar, , "R")
l:: MouseMove(MouseMoveSpeedVar, 0, , "R")
f:: mouseMoveSpeed(5)
d:: mouseMoveSpeed(2)
s:: mouseMoveSpeed(0.3)
a:: mouseMoveSpeed(0.1)
o:: Click("Right")
i::Click
,:: {
  if not GetKeyState("WheelUp")
    send "{WheelUp}"
} 
.:: {
  if not GetKeyState("WheelDown")
    Send "{WheelDown}"
}